package kr.ac.jejuuniv.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="users")
public class User {
	@Id
	@Column(name="id", unique=true)
	private String id;
	@Column(name="name")
	private String name;
	@Column(name="password")
	private String password;
	@OneToMany
	@JoinColumn(name="userid", nullable=true)
	private List<Bookmark> bookmarkList;
	
	public User() {
		
	}

	public User(String id, String name, String password) {
		this.setId(id);
		this.setName(name);
		this.setPassword(password);
	}
	
	public void setId(String id) {
		this.id = id;
	}

	
	public String getId() {
		return id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	
	public String getPassword() {
		return password;
	}
	
	public List<Bookmark> getBookmarkList() {
		return bookmarkList;
	}

	public void setBookmarkList(List<Bookmark> bookmarkList) {
		this.bookmarkList = bookmarkList;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", name=" + name + ", password=" + password
				+ ", bookmarkList=" + bookmarkList + "]";
	}

}
